﻿using System;
using System.Collections.Generic;
using System.Text;
using xReplace;
using System.IO;

namespace BareBonesPlugin
{
    class ExampleCommand : AbstractProcessingCommand
    {
        public ExampleCommand(ref Content pipes)
            : base(ref pipes)
        { }

        public override bool ProcessCommand(System.Xml.XmlNodeList param)
        {
            string message = this.GetNodeValue("message", param);
            string allowOutput = this.GetNodeValue("allowoutput", param);
            string toLabel = this.GetNodeValue("toLabel",param);
            if (!this.NodeExists("toLabel", param))
                throw new Exception("Example syntax error!");

            contentPipelines.StoreContent(toLabel, message);

            if (allowOutput.ToLower() == "true") return true;
            return false;
        }
    }
}
